package no.ntnu.item.ttm4115.termproject.extrasagent;

import java.util.ArrayList;
import java.util.Vector;

import no.ntnu.item.ttm4115.termproject.extrasagent.Location;
import no.ntnu.item.ttm4115.termproject.extrasagent.Preferences;
import no.ntnu.item.ttm4115.termproject.extrasagent.Group;
import no.tellu.common.javaframe.ActorAddress;

public class Player {
	private String userName;
	private String password;
	private String location; // redundant,but big effort to replace?
	private String status;
	private Preferences pref;
	private Location loc;
	private int id;
	private boolean im;
	private boolean chat;
	private boolean discussion;
	private boolean locationAwareness;
	private boolean communityAwareness;
	private Vector<Group> groups;
	private ArrayList<Player> matchList;
	
	public Player(){
		super();
		this.groups = new Vector<Group>();
	}
	// OUR constructor
	public Player(String username, String location, String status, ActorAddress address,Location loc, Preferences pref){
		super();
		this.userName = username;
		this.location = location;
		this.status = status;
		this.actorAddress = address;
		this.pref = pref;
		this.loc =loc;
		this.matchList = new ArrayList<Player>();
		this.groups = new Vector<Group>();
	}
	
	
	
	public Player(String username, String location, String status, ActorAddress address){
		super();
		this.userName = username;
		this.location = location;
		this.status = status;
		this.actorAddress = address;
		this.pref = new Preferences("","","","","");
		this.loc = new Location("0","0");
		this.matchList = new ArrayList<Player>();
		this.groups = new Vector<Group>();
	}
	
	public Player(String username, String location, String status){
		super();
		this.userName = username;
		this.location = location;
		this.status = status;
		this.pref = new Preferences("","","","","");
		this.loc = new Location("0","0");
		this.matchList = new ArrayList<Player>();
		this.groups = new Vector<Group>();
	}
	
	
	private ActorAddress actorAddress;

	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public ActorAddress getActorAddress() {
		return actorAddress;
	}
	public void setActorAddress(ActorAddress actorAddress) {
		this.actorAddress = actorAddress;
	}
	public boolean isIm() {
		return im;
	}
	public void setIm(boolean im) {
		this.im = im;
	}
	public boolean isChat() {
		return chat;
	}
	public void setChat(boolean chat) {
		this.chat = chat;
	}
	public boolean isDiscussion() {
		return discussion;
	}
	public void setDiscussion(boolean discussion) {
		this.discussion = discussion;
	}
	public Vector<Group> getGroups() {
		return groups;
	}
	public void setGroups(Vector<Group> groups) {
		this.groups = groups;
	}
	public boolean isLocationAwareness() {
		return locationAwareness;
	}
	public void setLocationAwareness(boolean locationAwareness) {
		this.locationAwareness = locationAwareness;
	}
	public boolean isCommunityAwareness() {
		return communityAwareness;
	}
	public void setCommunityAwareness(boolean communityAwareness) {
		this.communityAwareness = communityAwareness;
	}
	public void addGroup(Group g){
		if(groups.equals(null)){
			groups = new Vector<Group>();		
			groups.add(g);
		}else{
			groups.add(g);
		}
	}
	
	public void setLocation(String location){
		this.location = location;
	}
	
	public String getLocation(){
		return this.location;
	}
	
	public void setStatus(String status){
		this.status = status;
	}
	
	public String getStatus(){
		return this.status;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setPreferences(Preferences preferences){
		this.pref = preferences;
		
	}

	
	public Preferences getPreferences(){
		return this.pref;
	}

	public void setlocation(Location location){
		this.loc = location;
	}
	public Location getlocation(){
		return this.loc;
	}

	public ArrayList<Player>getMatchList(){
		return this.matchList;
	}

	public void setMatchList(ArrayList<Player> aa){
		this.matchList = aa;
	}
}
